package org.melanesia.converters.jdbc;

import java.sql.CallableStatement;

import org.melanesia.converters.JavaToJdbcConverter;


/**
 * A simple pass-thru converter that does not convert values, only passes it thru returning specified JDBC Type.
 * This should be used for simple types like String, Integer, Double etc. that can be successfully handled by JDBC without conversion.
 * 
 * @author mkielar
 */
public class PassThruJdbcConverter implements JavaToJdbcConverter {

    private int jdbcType;
    
    public PassThruJdbcConverter(int jdbcType) {
        this.jdbcType = jdbcType;
    }
    
    @Override
    public Object convert(Object value, CallableStatement stmt, String parameterName) {
        return value;
    }

    @Override
    public int getJdbcType() {
        return jdbcType;
    }
}
